<template>
  <div class="user-login">
    <el-dialog
      title="登录"
      v-model="dialogVisible"
      width="30%"
      :show-close="false"
      :close-on-press-escape="false"
    >
      <el-button type="primary" @click="login">使用gitee登录</el-button>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="$emit('close')">取 消</el-button>
        </span>
      </template>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: 'UserLogin',
  data() {
    return {
      dialogVisible: true,
      giteeLoginApi: this.$store.state.config.giteeLoginApi,
    };
  },
  methods: {
    login() {
      window.location = this.giteeLoginApi;
    },
  },
};
</script>

<style>
.user-login {
  text-align: left;
}

.el-dialog__body {
  padding: 10px 20px;
}
</style>
